package com.cf.snake.modele;
/*
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.AffineTransform;
*/
import java.util.Random;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;

public class Grenouille extends Case {

	private final static Random RND = new Random();

	private int angle;

	public Grenouille() {
		super(getRandomX(), getRandomY());
	}

	private static int getRandomX() {
		return RND.nextInt(NBRE_DE_COLONNES);
	}

	private static int getRandomY() {
		return RND.nextInt(NBRE_DE_LIGNES);
	}

	public void nouvelleGrenouille() {
		setIndiceX(getRandomX());
		setIndiceY(getRandomY());
		this.angle = 0;
	}

	public void calcul() {
		// incrémentation de l'angle de 4 degrés
		this.angle += 4;
	}

	public void affichage(Canvas c) {
		
		Paint paint = new Paint();
		paint.setColor(Color.GREEN);
		paint.setStyle(Paint.Style.FILL);
		c.drawCircle(this.getX(),this.getY() , Constantes.CASE_EN_PIXELS/2, paint);
	}

}
